// this file is intended to be included only from Vector4.h.
#ifndef RS_VECTOR4_C_H
#define RS_VECTOR4_C_H


namespace rs
{

inline Vector4::Vector4(f32 x0, f32 y0, f32 z0, f32 w0)
: x(x0), y(y0), z(z0), w(w0)
{
}


inline Vector4::Vector4(const Vector3& v3, f32 w0)
: x(v3.getX()), y(v3.getY()), z(v3.getZ()), w(w0)
{
}


inline Vector4::Vector4(const Vector4& rhs)
: x(rhs.x), y(rhs.y), z(rhs.z), w(rhs.w)
{
}


inline Vector4& Vector4::operator=(const Vector4& rhs)
{
	x = rhs.x;
	y = rhs.y;
	z = rhs.z;
	w = rhs.w;

	return *this;
}


inline Vector4& Vector4::operator+=(const Vector4& rhs)
{
	x += rhs.x;
	y += rhs.y;
	z += rhs.z;
	w += rhs.w;

	return *this;
}


inline Vector4& Vector4::operator-=(const Vector4& rhs)
{
	x -= rhs.x;
	y -= rhs.y;
	z -= rhs.z;
	w -= rhs.w;

	return *this;
}


inline Vector4& Vector4::operator*=(const Vector4& rhs)
{
	x *= rhs.x;
	y *= rhs.y;
	z *= rhs.z;
	w *= rhs.w;

	return *this;
}


inline Vector4& Vector4::operator*=(f32 rhs)
{
	x *= rhs;
	y *= rhs;
	z *= rhs;
	w *= rhs;

	return *this;
}


inline Vector4& Vector4::operator/=(const Vector4& rhs)
{
	x /= rhs.x;
	y /= rhs.y;
	z /= rhs.z;
	w /= rhs.w;

	return *this;
}


inline Vector4& Vector4::operator/=(f32 rhs)
{
	x /= rhs;
	y /= rhs;
	z /= rhs;
	w /= rhs;

	return *this;
}


inline void Vector4::set(f32 x0, f32 y0, f32 z0, f32 w0)
{
	x = x0;
	y = y0;
	z = z0;
	w = w0;
}


inline f32 Vector4::getX() const { return x; }
inline f32 Vector4::getY() const { return y; }
inline f32 Vector4::getZ() const { return z; }
inline f32 Vector4::getW() const { return w; }


inline Vector4 operator+(const Vector4& lhs, const Vector4& rhs)
{
	Vector4 ret = lhs;
	ret += rhs;
	return ret;
}


inline Vector4 operator-(const Vector4& lhs, const Vector4& rhs)
{
	Vector4 ret = lhs;
	ret -= rhs;
	return ret;
}


inline Vector4 operator*(const Vector4& lhs, const Vector4& rhs)
{
	Vector4 ret = lhs;
	ret *= rhs;
	return ret;
}


inline Vector4 operator*(const Vector4& lhs, f32 f)
{
	Vector4 ret = lhs;
	ret *= f;
	return ret;
}


inline Vector4 operator*(f32 f, const Vector4& rhs)
{
	return rhs * f;
}


inline Vector4 operator/(const Vector4& lhs, const Vector4& rhs)
{
	Vector4 ret = lhs;
	ret /= rhs;
	return ret;
}


inline Vector4 operator/(const Vector4& lhs, f32 f)
{
	Vector4 ret = lhs;
	ret /= f;
	return ret;
}


} // namespace rs

#endif // #ifndef RS_VECTOR4_C_H
